require "migration_helpers"
class AddRoleToUser < ActiveRecord::Migration
  extend MigrationHelpers
  def self.up
    add_column :users, :role_id, :integer, :null =>false
    add_index(:users, :role_id)
    add_foreign_key(:users, :role_id, :roles)
  end

  def self.down
     remove_foreign_key(:users, :role_id)
     remove_index(:users, :role_id)
     remove_column :users, :role_id
  end
end
